/******************************************************************
 * @version      : 1.0
 * @Author       : zhl
 * @Date         : 2023-02-13 11:28:45
 * @LastEditors  : zhl
 * @E-Mail       : zhll168@163.com
 * @Description  : 对网关gpio的读写封装
 ******************************************************************/

#ifndef __GPIO_MANAGER_H__
#define __GPIO_MANAGER_H__
#include <stdint.h>

//寄存器首地址0
typedef struct _GPIO_DI_STATE{
    int GPIO_RESERVE_0  :1;
    int GPIO_DI_1       :1;
    int GPIO_DI_2       :1;
    int GPIO_RESERVE_3  :1;
    int GPIO_RESERVE_4  :1;
    int GPIO_RESERVE_5  :1;
    int GPIO_RESERVE_6  :1;
    int GPIO_RESERVE_7  :1;
    int GPIO_RESERVE_8  :1;
    int GPIO_RESERVE_9  :1;
    int GPIO_RESERVE_10 :1;
    int GPIO_RESERVE_11 :1;
    int GPIO_RESERVE_12 :1;
    int GPIO_RESERVE_13 :1;
    int GPIO_RESERVE_14 :1;
    int GPIO_RESERVE_15 :1;
}GPIO_DI_STATE;
//寄存器首地址16
typedef struct _GPIO_DO_STATE{
    int GPIO_RESERVE_0  :1;
    int GPIO_RESERVE_1  :1;
    int GPIO_RESERVE_2  :1;
    int GPIO_RESERVE_3  :1;
    int GPIO_RESERVE_4  :1;
    int GPIO_RESERVE_5  :1;
    int GPIO_RESERVE_6  :1;
    int GPIO_RESERVE_7  :1;
    int GPIO_RESERVE_8  :1;
    int GPIO_RESERVE_9  :1;
    int GPIO_RESERVE_10 :1;
    int GPIO_RESERVE_11 :1;
    int GPIO_RESERVE_12 :1;
    int GPIO_RESERVE_13 :1;
    int GPIO_RESERVE_14 :1;
    int GPIO_RESERVE_15 :1;
    int GPIO_RESERVE_16 :1;
    int GPIO_DO_17      :1;
    int GPIO_DO_18      :1;
    int GPIO_RESERVE_19 :1;
    int GPIO_RESERVE_20 :1;
    int GPIO_RESERVE_21 :1;
    int GPIO_RESERVE_22 :1;
    int GPIO_RESERVE_23 :1;
    int GPIO_RESERVE_24 :1;
    int GPIO_RESERVE_25 :1;
    int GPIO_RESERVE_26 :1;
    int GPIO_RESERVE_27 :1;
    int GPIO_RESERVE_28 :1;
    int GPIO_RESERVE_29 :1;
    int GPIO_RESERVE_30 :1;
    int GPIO_RESERVE_31 :1;
}GPIO_DO_STATE;





#ifdef __cplusplus
extern "C"{
#endif

extern int DO1_switch(uint8_t state);
extern int DO2_switch(uint8_t state);
extern int DO1_get_state();
extern int DO2_get_state();
extern int DI1_get_state();
extern int DI2_get_state();



#ifdef __cplusplus
}
#endif




#endif /* __GPIO_MANAGER_H__ */